inherit: true
-context: f28-experimental-api
-env:
- CONFIGOPTS: '--enable-experimental-api'
-
-tests:
- - ci/build-check.sh
-
----
-
-inherit: true
-
context: f28-minimal
env:
CONFIGOPTS: '--without-curl --without-soup --disable-gtk-doc --disable-man
inherit: true
-context: f28-experimental-api
-env:
- CONFIGOPTS: '--enable-experimental-api'
-
-tests:
- - ci/build-check.sh
-
----
-
-inherit: true
-
context: f28-minimal
env:
CONFIGOPTS: '--without-curl --without-soup --disable-gtk-doc --disable-man
src/libostree/ostree-deployment.h \
src/libostree/ostree-bootconfig-parser.h \
src/libostree/ostree-repo-deprecated.h \
- $(NULL)
-
-if ENABLE_EXPERIMENTAL_API
-libostree_public_headers += \
src/libostree/ostree-ref.h \
src/libostree/ostree-remote.h \
src/libostree/ostree-repo-finder.h \
src/libostree/ostree-repo-finder-mount.h \
src/libostree/ostree-repo-finder-override.h \
$(NULL)
-endif
# This one is generated via configure.ac, and the gtk-doc
# code hence needs to look in the builddir.
src/libostree/ostree-gpg-verify-result.c \
src/libostree/ostree-gpg-verify-result-private.h \
src/libostree/ostree-autocleanups.h \
+ src/libostree/ostree-bloom.c \
+ src/libostree/ostree-bloom-private.h \
+ src/libostree/ostree-repo-finder.c \
+ src/libostree/ostree-repo-finder-avahi.c \
+ src/libostree/ostree-repo-finder-config.c \
+ src/libostree/ostree-repo-finder-mount.c \
+ src/libostree/ostree-repo-finder-override.c \
$(NULL)
if USE_LIBARCHIVE
libostree_1_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
$(NULL)
endif
libostree_experimental_headers = \
- src/libostree/ostree-ref.h \
- src/libostree/ostree-remote.h \
- src/libostree/ostree-repo-finder.h \
- src/libostree/ostree-repo-finder-avahi.h \
- src/libostree/ostree-repo-finder-config.h \
- src/libostree/ostree-repo-finder-mount.h \
- src/libostree/ostree-repo-finder-override.h \
$(NULL)
if !ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += $(libostree_experimental_headers)
else # if ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += \
- src/libostree/ostree-bloom.c \
- src/libostree/ostree-bloom-private.h \
- src/libostree/ostree-repo-finder.c \
- src/libostree/ostree-repo-finder-avahi.c \
- src/libostree/ostree-repo-finder-config.c \
- src/libostree/ostree-repo-finder-mount.c \
- src/libostree/ostree-repo-finder-override.c \
$(NULL)
+endif
if USE_AVAHI
libostree_1_la_SOURCES += \
src/libostree/ostree-repo-finder-avahi-private.h \
$(NULL)
endif # USE_AVAHI
-endif
symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym
if BUILDOPT_IS_DEVEL_BUILD
symbol_files += $(top_srcdir)/src/libostree/libostree-devel.sym
endif
-if ENABLE_EXPERIMENTAL_API
-symbol_files += $(top_srcdir)/src/libostree/libostree-experimental.sym
-endif
# http://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html
wl_versionscript_arg = -Wl,--version-script=
EXTRA_DIST += \
$(top_srcdir)/src/libostree/libostree-devel.sym \
- $(top_srcdir)/src/libostree/libostree-experimental.sym \
$(top_srcdir)/src/libostree/libostree-released.sym \
$(NULL)
libostree_1_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
endif
-if ENABLE_EXPERIMENTAL_API
if USE_AVAHI
libostree_1_la_CFLAGS += $(OT_DEP_AVAHI_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_AVAHI_LIBS)
endif
-endif
if BUILDOPT_LIBSYSTEMD
libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)
ostree-admin-undeploy.1 ostree-admin-upgrade.1 ostree-admin-unlock.1 \
ostree-admin-pin.1 \
ostree-admin.1 ostree-cat.1 ostree-checkout.1 ostree-checksum.1 \
-ostree-commit.1 ostree-export.1 ostree-gpg-sign.1 ostree-config.1 \
-ostree-diff.1 ostree-fsck.1 ostree-init.1 ostree-log.1 ostree-ls.1 \
-ostree-prune.1 ostree-pull-local.1 ostree-pull.1 ostree-refs.1 \
-ostree-remote.1 ostree-reset.1 ostree-rev-parse.1 ostree-show.1 \
-ostree-summary.1 ostree-static-delta.1
+ostree-commit.1 ostree-create-usb.1 ostree-export.1 ostree-gpg-sign.1 \
+ostree-config.1 ostree-diff.1 ostree-find-remotes.1 ostree-fsck.1 \
+ostree-init.1 ostree-log.1 ostree-ls.1 ostree-prune.1 ostree-pull-local.1 \
+ostree-pull.1 ostree-refs.1 ostree-remote.1 ostree-reset.1 \
+ostree-rev-parse.1 ostree-show.1 ostree-summary.1 \
+ostree-static-delta.1
if BUILDOPT_TRIVIAL_HTTPD
man1_files += ostree-trivial-httpd.1
else
man1_files += rofiles-fuse.1
endif
-if ENABLE_EXPERIMENTAL_API
-man1_files += ostree-find-remotes.1 ostree-create-usb.1
-endif
-
man5_files = ostree.repo.5 ostree.repo-config.5
man1_MANS = $(addprefix man/,$(man1_files))
src/ostree/ot-builtin-checkout.c \
src/ostree/ot-builtin-checksum.c \
src/ostree/ot-builtin-commit.c \
+ src/ostree/ot-builtin-create-usb.c \
src/ostree/ot-builtin-diff.c \
src/ostree/ot-builtin-export.c \
+ src/ostree/ot-builtin-find-remotes.c \
src/ostree/ot-builtin-fsck.c \
src/ostree/ot-builtin-gpg-sign.c \
src/ostree/ot-builtin-init.c \
if ENABLE_EXPERIMENTAL_API
ostree_SOURCES += \
- src/ostree/ot-builtin-create-usb.c \
- src/ostree/ot-builtin-find-remotes.c \
$(NULL)
endif
# This overrides the glib-tap.mk emphasis on doing both, if we'd
# used e.g. `dist_test_scripts`.
dist_test_scripts = $(NULL)
-test_programs = $(NULL)
+test_programs = \
+ tests/test-bloom \
+ tests/test-repo-finder-config \
+ tests/test-repo-finder-mount \
+ $(NULL)
_installed_or_uninstalled_test_scripts = \
tests/test-basic.sh \
tests/test-basic-user.sh \
tests/test-summary-update.sh \
tests/test-summary-view.sh \
tests/test-no-initramfs.sh \
- $(NULL)
-
-experimental_test_scripts = \
tests/test-create-usb.sh \
tests/test-find-remotes.sh \
tests/test-fsck-collections.sh \
tests/test-summary-collections.sh \
tests/test-pull-collections.sh \
$(NULL)
+
+experimental_test_scripts = \
+ $(NULL)
test_extra_programs = \
tests/get-byte-order \
+ tests/repo-finder-mount \
$(NULL)
tests_get_byte_order_SOURCES = tests/get-byte-order.c
if ENABLE_EXPERIMENTAL_API
_installed_or_uninstalled_test_scripts += $(experimental_test_scripts)
-test_extra_programs += tests/repo-finder-mount
else
EXTRA_DIST += $(experimental_test_scripts)
endif
tests/test-gpg-verify-result tests/test-checksum tests/test-lzma tests/test-rollsum \
tests/test-basic-c tests/test-sysroot-c tests/test-pull-c tests/test-repo
-if ENABLE_EXPERIMENTAL_API
-test_programs += \
- tests/test-bloom \
- tests/test-repo-finder-config \
- tests/test-repo-finder-mount \
- $(NULL)
-
if USE_AVAHI
test_programs += tests/test-repo-finder-avahi
endif
-endif
# An interactive tool
noinst_PROGRAMS += tests/test-rollsum-cli
-<SECTION>
-<FILE>ostree-ref</FILE>
-OstreeCollectionRef
-ostree_collection_ref_new
-ostree_collection_ref_dup
-ostree_collection_ref_free
-ostree_collection_ref_hash
-ostree_collection_ref_equal
-OstreeCollectionRefv
-ostree_collection_ref_dupv
-ostree_collection_ref_freev
-<SUBSECTION Standard>
-ostree_collection_ref_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-remote</FILE>
-OstreeRemote
-ostree_remote_ref
-ostree_remote_unref
-ostree_remote_get_name
-ostree_remote_get_url
-<SUBSECTION Standard>
-ostree_remote_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-experimental</FILE>
-ostree_repo_find_remotes_async
-ostree_repo_find_remotes_finish
-ostree_repo_pull_from_remotes_async
-ostree_repo_pull_from_remotes_finish
-ostree_repo_resolve_keyring_for_collection
-OSTREE_REPO_METADATA_REF
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-finder</FILE>
-OstreeRepoFinder
-ostree_repo_finder_resolve_async
-ostree_repo_finder_resolve_finish
-ostree_repo_finder_resolve_all_async
-ostree_repo_finder_resolve_all_finish
-OstreeRepoFinderResult
-ostree_repo_finder_result_new
-ostree_repo_finder_result_dup
-ostree_repo_finder_result_free
-ostree_repo_finder_result_compare
-OstreeRepoFinderResultv
-ostree_repo_finder_result_freev
-<SUBSECTION Standard>
-ostree_repo_finder_get_type
-ostree_repo_finder_result_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-finder-avahi</FILE>
-OstreeRepoFinderAvahi
-ostree_repo_finder_avahi_new
-ostree_repo_finder_avahi_start
-ostree_repo_finder_avahi_stop
-<SUBSECTION Standard>
-ostree_repo_finder_avahi_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-finder-config</FILE>
-OstreeRepoFinderConfig
-ostree_repo_finder_config_new
-<SUBSECTION Standard>
-ostree_repo_finder_config_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-finder-mount</FILE>
-OstreeRepoFinderMount
-ostree_repo_finder_mount_new
-<SUBSECTION Standard>
-ostree_repo_finder_mount_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-repo-finder-override</FILE>
-OstreeRepoFinderOverride
-ostree_repo_finder_override_new
-ostree_repo_finder_override_add_uri
-<SUBSECTION Standard>
-ostree_repo_finder_override_get_type
-</SECTION>
-
-<SECTION>
-<FILE>ostree-misc-experimental</FILE>
-ostree_repo_get_collection_id
-ostree_repo_set_collection_id
-ostree_validate_collection_id
-ostree_repo_list_collection_refs
-ostree_repo_remote_list_collection_refs
-ostree_repo_set_collection_ref_immediate
-ostree_repo_transaction_set_collection_ref
-ostree_repo_resolve_collection_ref
-</SECTION>
ostree_sysroot_upgrader_get_type
ostree_sysroot_upgrader_flags_get_type
</SECTION>
+
+<SECTION>
+<FILE>ostree-ref</FILE>
+OstreeCollectionRef
+ostree_collection_ref_new
+ostree_collection_ref_dup
+ostree_collection_ref_free
+ostree_collection_ref_hash
+ostree_collection_ref_equal
+OstreeCollectionRefv
+ostree_collection_ref_dupv
+ostree_collection_ref_freev
+<SUBSECTION Standard>
+ostree_collection_ref_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-remote</FILE>
+OstreeRemote
+ostree_remote_ref
+ostree_remote_unref
+ostree_remote_get_name
+ostree_remote_get_url
+<SUBSECTION Standard>
+ostree_remote_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-experimental</FILE>
+ostree_repo_find_remotes_async
+ostree_repo_find_remotes_finish
+ostree_repo_pull_from_remotes_async
+ostree_repo_pull_from_remotes_finish
+ostree_repo_resolve_keyring_for_collection
+OSTREE_REPO_METADATA_REF
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-finder</FILE>
+OstreeRepoFinder
+ostree_repo_finder_resolve_async
+ostree_repo_finder_resolve_finish
+ostree_repo_finder_resolve_all_async
+ostree_repo_finder_resolve_all_finish
+OstreeRepoFinderResult
+ostree_repo_finder_result_new
+ostree_repo_finder_result_dup
+ostree_repo_finder_result_free
+ostree_repo_finder_result_compare
+OstreeRepoFinderResultv
+ostree_repo_finder_result_freev
+<SUBSECTION Standard>
+ostree_repo_finder_get_type
+ostree_repo_finder_result_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-finder-avahi</FILE>
+OstreeRepoFinderAvahi
+ostree_repo_finder_avahi_new
+ostree_repo_finder_avahi_start
+ostree_repo_finder_avahi_stop
+<SUBSECTION Standard>
+ostree_repo_finder_avahi_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-finder-config</FILE>
+OstreeRepoFinderConfig
+ostree_repo_finder_config_new
+<SUBSECTION Standard>
+ostree_repo_finder_config_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-finder-mount</FILE>
+OstreeRepoFinderMount
+ostree_repo_finder_mount_new
+<SUBSECTION Standard>
+ostree_repo_finder_mount_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-repo-finder-override</FILE>
+OstreeRepoFinderOverride
+ostree_repo_finder_override_new
+ostree_repo_finder_override_add_uri
+<SUBSECTION Standard>
+ostree_repo_finder_override_get_type
+</SECTION>
+
+<SECTION>
+<FILE>ostree-misc-experimental</FILE>
+ostree_repo_get_collection_id
+ostree_repo_set_collection_id
+ostree_validate_collection_id
+ostree_repo_list_collection_refs
+ostree_repo_remote_list_collection_refs
+ostree_repo_set_collection_ref_immediate
+ostree_repo_transaction_set_collection_ref
+ostree_repo_resolve_collection_ref
+</SECTION>
fi
}
+# Find refs associated with the given collection ID under $repo_path.
+__ostree_compreply_collection_refs() {
+ local collection_id=( $1 )
+ refs=$( ostree refs --repo $repo_path --collections $collection_id 2>/dev/null | cut -d ' ' -f 2 | sed -e 's/)$//' )
+ COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
+}
+
# Find refs under $repo_path.
__ostree_compreply_refs() {
refs=$( ostree refs --repo $repo_path 2>/dev/null )
COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
}
+# Find collection IDs under $repo_path.
+__ostree_compreply_collection_ids() {
+ collection_ids=$( ostree refs --repo $repo_path --collections 2>/dev/null | cut -d ',' -f 1 | sed -e 's/^(//' | sort | uniq )
+ COMPREPLY+=( $( compgen -W "$collection_ids" -- "$cur" ) )
+}
+
# Find remotes under $repo_path.
__ostree_compreply_remotes() {
remotes=$( ostree remote list --repo $repo_path 2> /dev/null )
return 0
}
+_ostree_create_usb() {
+ local boolean_options="
+ $main_boolean_options
+ --disable-fsync
+ "
+
+ local options_with_args="
+ --destination-repo
+ --repo
+ "
+
+ local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
+
+ case "$prev" in
+ --destination-repo|--repo)
+ __ostree_compreply_dirs_only
+ return 0
+ ;;
+ $options_with_args_glob )
+ return 0
+ ;;
+ esac
+
+ case "$cur" in
+ -*)
+ local all_options="$boolean_options $options_with_args"
+ __ostree_compreply_all_options
+ ;;
+ *)
+ local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
+
+ if [ $cword -eq $argpos ]; then
+ __ostree_compreply_dirs_only
+ elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
+ __ostree_compreply_collection_ids
+ elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
+ __ostree_compreply_collection_refs "${words[$cword - 1]}"
+ fi
+ esac
+
+ return 0
+}
+
_ostree_diff() {
local boolean_options="
$main_boolean_options
return 0
}
+_ostree_find_remotes() {
+ local boolean_options="
+ $main_boolean_options
+ --disable-fsync
+ --pull
+ "
+
+ local options_with_args="
+ --finders
+ --repo
+ "
+
+ local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
+
+ case "$prev" in
+ --finders)
+ local choices="config lan mount"
+ local config_first="config,lan config,mount config,lan,mount config,mount,lan"
+ local lan_first="lan,config lan,mount lan,config,mount lan,mount,config"
+ local mount_first="mount,config mount,lan mount,lan,config mount,config,lan"
+ COMPREPLY+=( $( compgen -W "$choices $config_first $lan_first $mount_first" -- "$cur" ) )
+ return 0
+ ;;
+ --repo)
+ __ostree_compreply_dirs_only
+ return 0
+ ;;
+ $options_with_args_glob )
+ return 0
+ ;;
+ esac
+
+ case "$cur" in
+ -*)
+ local all_options="$boolean_options $options_with_args"
+ __ostree_compreply_all_options
+ ;;
+ *)
+ local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
+
+ if [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
+ __ostree_compreply_collection_ids
+ elif [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
+ __ostree_compreply_collection_refs "${words[$cword - 1]}"
+ fi
+ esac
+
+ return 0
+}
+
_ostree_fsck() {
local boolean_options="
$main_boolean_options
"
local options_with_args="
+ --collection-id
--mode
--repo
"
local boolean_options="
$main_boolean_options
--alias -A
+ --collections -c
--delete
--list
"
"
local options_with_args="
+ --collection-id
--contenturl
--gpg-import
--repo
checksum
commit
config
+ create-usb
diff
export
+ find-remotes
fsck
gpg-sign
init
release_build_type=release)
OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
+# P2P API is public in OSTree >= 2018.6
+OSTREE_FEATURES="$OSTREE_FEATURES p2p"
+
AC_CONFIG_FILES([
Makefile
apidoc/Makefile
<refsect1>
<title>Description</title>
- <!-- FIXME: Reword this when no longer in experimental -->
<para>
OSTree has the ability do pulls not just from configured remote
servers but also from peer computers on the LAN and from mounted
- filesystems such as USB drives. Currently this requires compiling
- OSTree with experimental API enabled, and it requires the use of
- collection IDs and GPG verification.
+ filesystems such as USB drives. This functionality requires the use
+ of collection IDs and GPG verification.
</para>
<para>
The <command>find-remotes</command> command searches for remotes
fields to the summary.
</para>
- <!-- FIXME: Uncomment this when collection ID support becomes non-experimental.
<para>If the repository has a collection ID configured, the
<filename>ostree-metadata</filename> branch for that collection ID
will also be updated with a new commit containing the given metadata,
which will be signed if the summary file is signed.</para>
- -->
</listitem>
</varlistentry>
</para></listitem>
</varlistentry>
- <!-- FIXME: Uncomment this when it's no longer experimental
<varlistentry>
<term><citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>
Put the given refs on an external drive for P2P distribution.
</para></listitem>
- </varlistentry>-->
+ </varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>ostree-diff</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
</para></listitem>
</varlistentry>
- <!-- FIXME: Uncomment this when it's no longer experimental
<varlistentry>
<term><citerefentry><refentrytitle>ostree-find-remotes</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>
Find remotes to serve the given refs.
</para></listitem>
- </varlistentry>-->
+ </varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>ostree-fsck</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
/* Add new symbols here. Release commits should copy this section into -released.sym. */
LIBOSTREE_2018.6 {
+global:
+ ostree_collection_ref_dup;
+ ostree_collection_ref_dupv;
+ ostree_collection_ref_equal;
+ ostree_collection_ref_free;
+ ostree_collection_ref_freev;
+ ostree_collection_ref_get_type;
+ ostree_collection_ref_hash;
+ ostree_collection_ref_new;
+ ostree_remote_get_name;
+ ostree_remote_get_type;
+ ostree_remote_get_url;
+ ostree_remote_ref;
+ ostree_remote_unref;
+ ostree_repo_find_remotes_async;
+ ostree_repo_find_remotes_finish;
+ ostree_repo_finder_avahi_get_type;
+ ostree_repo_finder_avahi_new;
+ ostree_repo_finder_avahi_start;
+ ostree_repo_finder_avahi_stop;
+ ostree_repo_finder_config_get_type;
+ ostree_repo_finder_config_new;
+ ostree_repo_finder_get_type;
+ ostree_repo_finder_mount_get_type;
+ ostree_repo_finder_mount_new;
+ ostree_repo_finder_override_add_uri;
+ ostree_repo_finder_override_get_type;
+ ostree_repo_finder_override_new;
+ ostree_repo_finder_resolve_all_async;
+ ostree_repo_finder_resolve_all_finish;
+ ostree_repo_finder_resolve_async;
+ ostree_repo_finder_resolve_finish;
+ ostree_repo_finder_result_compare;
+ ostree_repo_finder_result_dup;
+ ostree_repo_finder_result_free;
+ ostree_repo_finder_result_freev;
+ ostree_repo_finder_result_get_type;
+ ostree_repo_finder_result_new;
+ ostree_repo_get_collection_id;
+ ostree_repo_list_collection_refs;
+ ostree_repo_pull_from_remotes_async;
+ ostree_repo_pull_from_remotes_finish;
+ ostree_repo_remote_list_collection_refs;
+ ostree_repo_resolve_collection_ref;
+ ostree_repo_resolve_keyring_for_collection;
+ ostree_repo_set_collection_id;
+ ostree_repo_set_collection_ref_immediate;
+ ostree_repo_transaction_set_collection_ref;
ostree_repo_traverse_reachable_refs;
ostree_sysroot_cleanup_prune_repo;
+ ostree_validate_collection_id;
} LIBOSTREE_2018.5;
/* Stub section for the stable release *after* this development one; don't
+++ /dev/null
-/*
- * Copyright © 2017 Endless Mobile, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * - Philip Withnall <withnall@endlessm.com>
- */
-
-/* Symbols in this file are added to the build if OSTree is configured with
- * --enable-experimental-api. They are not stable or officially supported, and
- * might disappear or change in future releases. */
-
-LIBOSTREE_2017.6_EXPERIMENTAL {
-global:
- ostree_remote_ref;
- ostree_remote_unref;
-} LIBOSTREE_2017.6;
-
-LIBOSTREE_2017.7_EXPERIMENTAL {
-global:
- ostree_remote_get_name;
-} LIBOSTREE_2017.6_EXPERIMENTAL;
-
-LIBOSTREE_2017.8_EXPERIMENTAL {
-global:
- ostree_collection_ref_dup;
- ostree_collection_ref_dupv;
- ostree_collection_ref_equal;
- ostree_collection_ref_free;
- ostree_collection_ref_freev;
- ostree_collection_ref_get_type;
- ostree_collection_ref_hash;
- ostree_collection_ref_new;
- ostree_repo_find_remotes_async;
- ostree_repo_find_remotes_finish;
- ostree_repo_finder_avahi_get_type;
- ostree_repo_finder_avahi_new;
- ostree_repo_finder_avahi_start;
- ostree_repo_finder_avahi_stop;
- ostree_repo_finder_config_get_type;
- ostree_repo_finder_config_new;
- ostree_repo_finder_get_type;
- ostree_repo_finder_mount_get_type;
- ostree_repo_finder_mount_new;
- ostree_repo_finder_resolve_async;
- ostree_repo_finder_resolve_all_async;
- ostree_repo_finder_resolve_all_finish;
- ostree_repo_finder_resolve_finish;
- ostree_repo_finder_result_compare;
- ostree_repo_finder_result_dup;
- ostree_repo_finder_result_free;
- ostree_repo_finder_result_freev;
- ostree_repo_finder_result_get_type;
- ostree_repo_finder_result_new;
- ostree_repo_get_collection_id;
- ostree_repo_list_collection_refs;
- ostree_repo_pull_from_remotes_async;
- ostree_repo_pull_from_remotes_finish;
- ostree_repo_remote_list_collection_refs;
- ostree_repo_resolve_keyring_for_collection;
- ostree_repo_set_collection_id;
- ostree_repo_set_collection_ref_immediate;
- ostree_repo_transaction_set_collection_ref;
- ostree_validate_collection_id;
-} LIBOSTREE_2017.7_EXPERIMENTAL;
-
-LIBOSTREE_2017.12_EXPERIMENTAL {
-global:
- ostree_repo_resolve_collection_ref;
-} LIBOSTREE_2017.8_EXPERIMENTAL;
-
-LIBOSTREE_2017.13_EXPERIMENTAL {
-global:
- ostree_repo_finder_override_add_uri;
- ostree_repo_finder_override_get_type;
- ostree_repo_finder_override_new;
-} LIBOSTREE_2017.12_EXPERIMENTAL;
-
-LIBOSTREE_2017.14_EXPERIMENTAL {
-global:
- ostree_remote_get_type;
- ostree_remote_get_url;
-} LIBOSTREE_2017.13_EXPERIMENTAL;
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (OstreeRepoCommitTraverseIter, ostree_repo_commit_traverse_iter_clear)
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeCollectionRef, ostree_collection_ref_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeCollectionRefv, ostree_collection_ref_freev, NULL)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRemote, ostree_remote_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#endif
GCancellable *cancellable,
GError **error);
-#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
-gboolean ostree_validate_collection_id (const char *collection_id, GError **error);
-#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
-
gboolean
_ostree_compare_timestamps (const char *current_rev,
guint64 current_ts,
guint64 new_ts,
GError **error);
-#if (defined(OSTREE_COMPILATION) || GLIB_CHECK_VERSION(2, 44, 0)) && !defined(OSTREE_ENABLE_EXPERIMENTAL_API)
-#include <libglnx.h>
-#include "ostree-ref.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeCollectionRef, ostree_collection_ref_free)
-G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeCollectionRefv, ostree_collection_ref_freev, NULL)
-
-#include "ostree-repo-finder.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinder, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
-G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
-
-#include "ostree-repo-finder-avahi.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderAvahi, g_object_unref)
-
-#include "ostree-repo-finder-config.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderConfig, g_object_unref)
-
-#include "ostree-repo-finder-mount.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderMount, g_object_unref)
-
-#include "ostree-repo-finder-override.h"
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
-#endif
-
G_END_DECLS
*
* Returns: %TRUE if @collection_id is a valid collection ID, %FALSE if it is invalid
* or %NULL
+ * Since: 2018.6
*/
gboolean
ostree_validate_collection_id (const char *collection_id, GError **error)
* This is most useful in concert with `OSTREE_COMMIT_META_KEY_REF_BINDING`,
* as it more strongly binds the commit to the repository and branch.
*
- * Since: 2017.9
+ * Since: 2018.6
*/
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#define OSTREE_COMMIT_META_KEY_COLLECTION_BINDING "ostree.collection-binding"
-#endif
_OSTREE_PUBLIC
const GVariantType *ostree_metadata_variant_type (OstreeObjectType objtype);
_OSTREE_PUBLIC
gboolean ostree_validate_rev (const char *rev, GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_validate_collection_id (const char *collection_id, GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_validate_remote_name (const char *remote_name, GError **error);
* operations.
*
* Returns: (transfer full): a new #OstreeCollectionRef
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeCollectionRef *
ostree_collection_ref_new (const gchar *collection_id,
* Create a copy of the given @ref.
*
* Returns: (transfer full): a newly allocated copy of @ref
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeCollectionRef *
ostree_collection_ref_dup (const OstreeCollectionRef *ref)
*
* Free the given @ref.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_collection_ref_free (OstreeCollectionRef *ref)
* @ref must be non-%NULL.
*
* Returns: hash value for @ref
- * Since: 2017.8
+ * Since: 2018.6
*/
guint
ostree_collection_ref_hash (gconstpointer ref)
* ref name, and %FALSE otherwise. Both @ref1 and @ref2 must be non-%NULL.
*
* Returns: %TRUE if @ref1 and @ref2 are equal, %FALSE otherwise
- * Since: 2017.8
+ * Since: 2018.6
*/
gboolean
ostree_collection_ref_equal (gconstpointer ref1,
* %NULL.
*
* Returns: (transfer full) (array zero-terminated=1): a newly allocated copy of @refs
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeCollectionRef **
ostree_collection_ref_dupv (const OstreeCollectionRef * const *refs)
* Free the given array of @refs, including freeing all its elements. @refs
* must be %NULL-terminated; it may be empty, but must not be %NULL.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_collection_ref_freev (OstreeCollectionRef **refs)
* (@collection_id, @ref_name). For backwards compatibility, @collection_id may be %NULL,
* indicating a ref name which is not globally unique.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
typedef struct
{
* g_auto(OstreeCollectionRefv) refs = NULL;
* ]|
*
- * Since: 2017.8
+ * Since: 2018.6
*/
typedef OstreeCollectionRef** OstreeCollectionRefv;
OstreeRemote *ostree_remote_new_from_keyfile (GKeyFile *keyfile,
const gchar *group);
-#if (defined(OSTREE_COMPILATION) || GLIB_CHECK_VERSION(2, 44, 0)) && !defined(OSTREE_ENABLE_EXPERIMENTAL_API)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRemote, ostree_remote_unref)
-#endif
-
G_END_DECLS
* refs are currently on a remote, or the commits they currently point to. Use
* #OstreeRepo in combination with an #OstreeRemote to query that information.
*
- * Since: 2017.6
+ * Since: 2018.6
*/
OstreeRemote *
* Increase the reference count on the given @remote.
*
* Returns: (transfer full): a copy of @remote, for convenience
- * Since: 2017.6
+ * Since: 2018.6
*/
OstreeRemote *
ostree_remote_ref (OstreeRemote *remote)
* Decrease the reference count on the given @remote and free it if the
* reference count reaches 0.
*
- * Since: 2017.6
+ * Since: 2018.6
*/
void
ostree_remote_unref (OstreeRemote *remote)
}
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
G_DEFINE_BOXED_TYPE(OstreeRemote, ostree_remote,
ostree_remote_ref,
ostree_remote_unref);
-#endif
/**
* ostree_remote_get_name:
* arbitrary, string.
*
* Returns: remote’s name
- * Since: 2017.7
+ * Since: 2018.6
*/
const gchar *
ostree_remote_get_name (OstreeRemote *remote)
* Get the URL from the remote.
*
* Returns: (transfer full): the remote's URL
- * Since: 2017.14
+ * Since: 2018.6
*/
gchar *
ostree_remote_get_url (OstreeRemote *remote)
* remotes can only be passed around as (reference counted) opaque handles. In
* future, more API may be added to create and interrogate them.
*
- * Since: 2017.6
+ * Since: 2018.6
*/
-#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
-/* This is in ostree-types.h otherwise */
-typedef struct OstreeRemote OstreeRemote;
-#endif
_OSTREE_PUBLIC
GType ostree_remote_get_type (void) G_GNUC_CONST;
*
* Multithreading: Since v2017.15 this function is MT safe.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
* case where we're creating or overwriting an existing ref.
*
* Returns: %TRUE on success, %FALSE otherwise
- * Since: 2017.8
+ * Since: 2018.6
*/
gboolean
ostree_repo_set_collection_ref_immediate (OstreeRepo *self,
* and the resolver is used to retrieve information about services advertised by
* each peer, including the services’ TXT records.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
#ifdef HAVE_AVAHI
* If @context is %NULL, the current thread-default #GMainContext is used.
*
* Returns: (transfer full): a new #OstreeRepoFinderAvahi
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderAvahi *
ostree_repo_finder_avahi_new (GMainContext *context)
* #OstreeRepoFinderAvahi instance, or to call it after
* ostree_repo_finder_avahi_stop().
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_avahi_start (OstreeRepoFinderAvahi *self,
* #OstreeRepoFinderAvahi instance, or to call it before
* ostree_repo_finder_avahi_start().
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_avahi_stop (OstreeRepoFinderAvahi *self)
* intersection is non-empty, that remote is returned as a result. Remotes which
* do not have their `collection-id` key configured are ignored.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
static void ostree_repo_finder_config_iface_init (OstreeRepoFinderInterface *iface);
* Create a new #OstreeRepoFinderConfig.
*
* Returns: (transfer full): a new #OstreeRepoFinderConfig
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderConfig *
ostree_repo_finder_config_new (void)
* The volume monitor used to find mounted volumes can be overridden by setting
* #OstreeRepoFinderMount:monitor. By default, g_volume_monitor_get() is used.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
typedef GList/*<owned GObject>*/ ObjectList;
*
* Volume monitor to use to look up mounted volumes when queried.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
g_object_class_install_property (object_class, PROP_MONITOR,
g_param_spec_object ("monitor",
* be used.
*
* Returns: (transfer full): a new #OstreeRepoFinderMount
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderMount *
ostree_repo_finder_mount_new (GVolumeMonitor *monitor)
* which uses #OstreeRepoFinder. For production use, #OstreeRepoFinderConfig is
* recommended instead.
*
- * Since: 2017.13
+ * Since: 2018.6
*/
static void ostree_repo_finder_override_iface_init (OstreeRepoFinderInterface *iface);
* Create a new #OstreeRepoFinderOverride.
*
* Returns: (transfer full): a new #OstreeRepoFinderOverride
- * Since: 2017.13
+ * Since: 2018.6
*/
OstreeRepoFinderOverride *
ostree_repo_finder_override_new (void)
* Add the given @uri to the set of URIs which the repo finder will search for
* matching refs when ostree_repo_finder_resolve_async() is called on it.
*
- * Since: 2017.13
+ * Since: 2018.6
*/
void
ostree_repo_finder_override_add_uri (OstreeRepoFinderOverride *self,
* Pass the results to ostree_repo_pull_from_remotes_async() to pull the given
* @refs from those remotes.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_resolve_async (OstreeRepoFinder *self,
*
* Returns: (transfer full) (element-type OstreeRepoFinderResult): array of zero
* or more results
- * Since: 2017.8
+ * Since: 2018.6
*/
GPtrArray *
ostree_repo_finder_resolve_finish (OstreeRepoFinder *self,
* A version of ostree_repo_finder_resolve_async() which queries one or more
* @finders in parallel and combines the results.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_resolve_all_async (OstreeRepoFinder * const *finders,
*
* Returns: (transfer full) (element-type OstreeRepoFinderResult): array of zero
* or more results
- * Since: 2017.8
+ * Since: 2018.6
*/
GPtrArray *
ostree_repo_finder_resolve_all_finish (GAsyncResult *result,
* are as described in the #OstreeRepoFinderResult documentation.
*
* Returns: (transfer full): a new #OstreeRepoFinderResult
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderResult *
ostree_repo_finder_result_new (OstreeRemote *remote,
* Copy an #OstreeRepoFinderResult.
*
* Returns: (transfer full): a newly allocated copy of @result
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderResult *
ostree_repo_finder_result_dup (OstreeRepoFinderResult *result)
*
* Returns: <0 if @a is ordered before @b, 0 if they are ordered equally,
* >0 if @b is ordered before @a
- * Since: 2017.8
+ * Since: 2018.6
*/
gint
ostree_repo_finder_result_compare (const OstreeRepoFinderResult *a,
*
* Free the given @result.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_result_free (OstreeRepoFinderResult *result)
*
* Free the given @results array, freeing each element and the container.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_finder_result_freev (OstreeRepoFinderResult **results)
* ostree_repo_find_remotes_async (2) there was an error in trying to get the
* commit metadata (3) the checksum for this ref is %NULL in @ref_to_checksum.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
typedef struct
{
* g_auto(OstreeRepoFinderResultv) results = NULL;
* ]|
*
- * Since: 2017.8
+ * Since: 2018.6
*/
typedef OstreeRepoFinderResult** OstreeRepoFinderResultv;
void _ostree_repo_auto_lock_cleanup (OstreeRepoAutoLock *lock);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoAutoLock, _ostree_repo_auto_lock_cleanup)
-#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
-
-/* These APIs are duplicated in the public headers when doing an
- * experimental-API build.
- */
-const gchar * ostree_repo_get_collection_id (OstreeRepo *self);
-gboolean ostree_repo_set_collection_id (OstreeRepo *self,
- const gchar *collection_id,
- GError **error);
-
-gboolean ostree_repo_list_collection_refs (OstreeRepo *self,
- const char *match_collection_id,
- GHashTable **out_all_refs,
- OstreeRepoListRefsExtFlags flags,
- GCancellable *cancellable,
- GError **error);
-
-void ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
- const OstreeCollectionRef *ref,
- const char *checksum);
-
-gboolean ostree_repo_set_collection_ref_immediate (OstreeRepo *self,
- const OstreeCollectionRef *ref,
- const char *checksum,
- GCancellable *cancellable,
- GError **error);
-
-#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
-
G_END_DECLS
#include "ostree-remote-private.h"
#include "ot-fs-utils.h"
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include "ostree-repo-finder.h"
#include "ostree-repo-finder-config.h"
#include "ostree-repo-finder-mount.h"
#ifdef HAVE_AVAHI
#include "ostree-repo-finder-avahi.h"
#endif /* HAVE_AVAHI */
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#include <gio/gunixinputstream.h>
#include <sys/statvfs.h>
if (pull_data->remote_repo_local != NULL && ref->collection_id != NULL)
{
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!ostree_repo_resolve_collection_ref (pull_data->remote_repo_local,
ref, FALSE,
OSTREE_REPO_RESOLVE_REV_EXT_NONE,
&ret_contents, cancellable, error))
return FALSE;
-#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
- g_assert_not_reached ();
-#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
}
else if (pull_data->remote_repo_local != NULL)
{
if (collection_id != NULL)
{
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
const char *collection_id_binding;
if (!g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
"metadata, while the remote it came from has "
"collection ID ‘%s’",
collection_id_binding, collection_id);
-#endif
}
return TRUE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
/* Reads the collection-id of a given remote from the repo
* configuration.
*/
*
* Returns: (transfer full): #OstreeRemote containing the GPG keyring for
* @collection_id
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRemote *
ostree_repo_resolve_keyring_for_collection (OstreeRepo *self,
}
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
#ifdef HAVE_LIBCURL_OR_LIBSOUP
/* Look at a commit object, and determine whether there are
* branch, otherwise we requested a commit checksum without specifying a branch.
*/
g_autofree char *remote_collection_id = NULL;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
remote_collection_id = get_remote_repo_collection_id (pull_data);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!_ostree_repo_verify_bindings (remote_collection_id,
(ref != NULL) ? ref->ref_name : NULL,
commit, error))
return ret;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
/* Structure used in ostree_repo_find_remotes_async() which stores metadata
* about a given OSTree commit. This includes the metadata from the commit
* #GVariant, plus some working state which is used to work out which remotes
*
* This will use the thread-default #GMainContext, but will not iterate it.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_find_remotes_async (OstreeRepo *self,
* Returns: (transfer full) (array zero-terminated=1): a potentially empty array
* of #OstreeRepoFinderResults, followed by a %NULL terminator element; or
* %NULL on error
- * Since: 2017.8
+ * Since: 2018.6
*/
OstreeRepoFinderResult **
ostree_repo_find_remotes_finish (OstreeRepo *self,
* milliseconds, if any; only values higher than 0 are valid
* * `append-user-agent` (`s`): Additional string to append to the user agent
*
- * Since: 2017.8
+ * Since: 2018.6
*/
void
ostree_repo_pull_from_remotes_async (OstreeRepo *self,
* ostree_repo_pull_from_remotes_async().
*
* Returns: %TRUE on success, %FALSE otherwise
- * Since: 2017.8
+ * Since: 2018.6
*/
gboolean
ostree_repo_pull_from_remotes_finish (OstreeRepo *self,
return g_task_propagate_boolean (G_TASK (result), error);
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
/**
* ostree_repo_remote_fetch_summary_with_options:
* @self: Self
return FALSE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
void
ostree_repo_find_remotes_async (OstreeRepo *self,
const OstreeCollectionRef * const *refs,
return FALSE;
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
#endif /* HAVE_LIBCURL_OR_LIBSOUP */
return _ostree_repo_resolve_rev_internal (self, refspec, allow_noent, FALSE, out_rev, error);
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/**
* ostree_repo_resolve_collection_ref:
* @self: an #OstreeRepo
* There are currently no @flags which affect the behaviour of this function.
*
* Returns: %TRUE on success, %FALSE on failure
- * Since: 2017.12
+ * Since: 2018.6
*/
gboolean
ostree_repo_resolve_collection_ref (OstreeRepo *self,
*out_rev = g_strdup (ret_contents);
return TRUE;
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static gboolean
enumerate_refs_recurse (OstreeRepo *repo,
return TRUE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean
remote_list_collection_refs_process_refs (OstreeRepo *self,
const gchar *remote_name,
* Any refs for other collections stored in the repository will also be returned.
* No filtering is performed.
*
- * Since: 2017.10
+ * Since: 2018.6
*/
gboolean
ostree_repo_remote_list_collection_refs (OstreeRepo *self,
ot_transfer_out_value (out_all_refs, &ret_all_refs);
return TRUE;
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static char *
relative_symlink_to (const char *relpath,
* %OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES in @flags.
*
* Returns: %TRUE on success, %FALSE otherwise
- * Since: 2017.8
+ * Since: 2018.6
*/
gboolean
ostree_repo_list_collection_refs (OstreeRepo *self,
* Get the collection ID of this repository. See [collection IDs][collection-ids].
*
* Returns: (nullable): collection ID for the repository
- * Since: 2017.8
+ * Since: 2018.6
*/
const gchar *
ostree_repo_get_collection_id (OstreeRepo *self)
* configuration on disk using ostree_repo_write_config().
*
* Returns: %TRUE on success, %FALSE otherwise
- * Since: 2017.8
+ * Since: 2018.6
*/
gboolean
ostree_repo_set_collection_id (OstreeRepo *self,
#include "ostree-core.h"
#include "ostree-types.h"
#include "ostree-async-progress.h"
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include "ostree-ref.h"
#include "ostree-repo-finder.h"
-#endif
#include "ostree-sepolicy.h"
#include "ostree-gpg-verify-result.h"
GCancellable *cancellable,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
_OSTREE_PUBLIC
const gchar * ostree_repo_get_collection_id (OstreeRepo *self);
_OSTREE_PUBLIC
const gchar *collection_id,
GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
_OSTREE_PUBLIC
GFile * ostree_repo_get_path (OstreeRepo *self);
const char *ref,
const char *checksum);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
_OSTREE_PUBLIC
void ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
const OstreeCollectionRef *ref,
const char *checksum);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
_OSTREE_PUBLIC
gboolean ostree_repo_set_ref_immediate (OstreeRepo *self,
const char *remote,
GCancellable *cancellable,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
_OSTREE_PUBLIC
gboolean ostree_repo_set_collection_ref_immediate (OstreeRepo *self,
const OstreeCollectionRef *ref,
GCancellable *cancellable,
GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
_OSTREE_PUBLIC
gboolean ostree_repo_has_object (OstreeRepo *self,
OstreeObjectType objtype,
char **out_rev,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_repo_resolve_collection_ref (OstreeRepo *self,
const OstreeCollectionRef *ref,
char **out_rev,
GCancellable *cancellable,
GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_list_refs (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_repo_remote_list_collection_refs (OstreeRepo *self,
const char *remote_name,
GHashTable **out_all_refs,
GCancellable *cancellable,
GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_load_variant (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
_OSTREE_PUBLIC
void ostree_repo_find_remotes_async (OstreeRepo *self,
const OstreeCollectionRef * const *refs,
GCancellable *cancellable,
GError **error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
_OSTREE_PUBLIC
void ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress,
gpointer user_data);
GCancellable *cancellable,
GError **error);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
-
/**
* OSTREE_REPO_METADATA_REF:
*
* keys must be namespaced by product or developer. For example,
* `exampleos.end-of-life`. The `ostree.` prefix is reserved.
*
- * Since: 2017.8
+ * Since: 2018.6
*/
#define OSTREE_REPO_METADATA_REF "ostree-metadata"
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
G_END_DECLS
typedef struct OstreeSysrootUpgrader OstreeSysrootUpgrader;
typedef struct OstreeMutableTree OstreeMutableTree;
typedef struct OstreeRepoFile OstreeRepoFile;
-
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
typedef struct OstreeRemote OstreeRemote;
-#endif
G_END_DECLS
#include <ostree-core.h>
#include <ostree-repo.h>
#include <ostree-mutable-tree.h>
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include <ostree-remote.h>
-#endif
#include <ostree-repo-file.h>
#include <ostree-sysroot.h>
#include <ostree-sysroot-upgrader.h>
#include <ostree-bootconfig-parser.h>
#include <ostree-diff.h>
#include <ostree-gpg-verify-result.h>
-
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include <ostree-ref.h>
#include <ostree-repo-finder.h>
#include <ostree-repo-finder-avahi.h>
#include <ostree-repo-finder-config.h>
#include <ostree-repo-finder-mount.h>
#include <ostree-repo-finder-override.h>
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
-
#include <ostree-autocleanups.h>
#include <ostree-version.h>
{ "export", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_export,
"Stream COMMIT to stdout in tar format" },
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "find-remotes", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_find_remotes,
"Find remotes to serve the given refs" },
{ "create-usb", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_create_usb,
"Copy the refs to a USB stick" },
-#endif
{ "fsck", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_fsck,
"Check the repository for consistency" },
return TRUE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static void
add_collection_binding (OstreeRepo *repo,
GVariantBuilder *metadata_builder)
g_variant_builder_add (metadata_builder, "{s@v}", OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
g_variant_new_variant (g_variant_new_string (collection_id)));
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static int
compare_strings (gconstpointer a, gconstpointer b)
add_ref_binding (metadata_builder);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* Allow the collection ID to be overridden using
* --add-metadata-string=ostree.collection-binding=blah */
if (metadata == NULL ||
!g_variant_lookup (metadata, OSTREE_COMMIT_META_KEY_COLLECTION_BINDING, "*", NULL))
add_collection_binding (repo, metadata_builder);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
*out_metadata = g_variant_ref_sink (g_variant_builder_end (metadata_builder));
}
return FALSE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!opt_quiet)
g_print ("Validating refs in collections...\n");
&found_corruption, cancellable, error))
return FALSE;
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!opt_quiet)
g_print ("Enumerating objects...\n");
g_autoptr(GVariant) metadata = g_variant_get_child_value (commit, 0);
const char *collection_id = NULL;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
"&s",
&collection_id))
collection_id = NULL;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
g_autofree const char **refs = NULL;
if (g_variant_lookup (metadata,
{
g_autofree char *checksum_for_ref = NULL;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (collection_id != NULL)
{
const OstreeCollectionRef collection_ref = { (char *) collection_id, (char *) *iter };
return FALSE;
}
else
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{
if (!ostree_repo_resolve_rev (repo, *iter, TRUE,
&checksum_for_ref, error))
#include "ostree.h"
static char *opt_mode = "bare";
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static char *opt_collection_id = NULL;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* ATTENTION:
* Please remember to update the bash-completion script (bash/ostree) and
static GOptionEntry options[] = {
{ "mode", 0, 0, G_OPTION_ARG_STRING, &opt_mode, "Initialize repository in given mode (bare, bare-user, bare-user-only, archive)", NULL },
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collection-id", 0, 0, G_OPTION_ARG_STRING, &opt_collection_id,
"Globally unique ID for this repository as an collection of refs for redistribution to other repositories", "COLLECTION-ID" },
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ NULL }
};
if (!ostree_repo_mode_from_string (opt_mode, &mode, error))
goto out;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!ostree_repo_set_collection_id (repo, opt_collection_id, error))
goto out;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!ostree_repo_create (repo, mode, NULL, error))
goto out;
delete_commit (OstreeRepo *repo, const char *commit_to_delete, GCancellable *cancellable, GError **error)
{
g_autoptr(GHashTable) refs = NULL; /* (element-type utf8 utf8) */
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
g_autoptr(GHashTable) collection_refs = NULL; /* (element-type OstreeCollectionRef utf8) */
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* Check refs which are not in a collection. */
if (!ostree_repo_list_refs (repo, NULL, &refs, cancellable, error))
return glnx_throw (error, "Commit '%s' is referenced by '%s'", commit_to_delete, ref);
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* And check refs which *are* in a collection. */
if (!ostree_repo_list_collection_refs (repo, NULL, &collection_refs,
OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES,
return glnx_throw (error, "Commit '%s' is referenced by (%s, %s)",
commit_to_delete, ref->collection_id, ref->ref_name);
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!ot_enable_tombstone_commits (repo, error))
return FALSE;
static gboolean opt_list;
static gboolean opt_alias;
static char *opt_create;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean opt_collections;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* ATTENTION:
* Please remember to update the bash-completion script (bash/ostree) and
{ "list", 0, 0, G_OPTION_ARG_NONE, &opt_list, "Do not remove the prefix from the refs", NULL },
{ "alias", 'A', 0, G_OPTION_ARG_NONE, &opt_alias, "If used with --create, create an alias, otherwise just list aliases", NULL },
{ "create", 0, 0, G_OPTION_ARG_STRING, &opt_create, "Create a new ref for an existing commit", "NEWREF" },
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collections", 'c', 0, G_OPTION_ARG_NONE, &opt_collections, "Enable listing collection IDs for refs", NULL },
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ NULL }
};
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean
do_ref_with_collections (OstreeRepo *repo,
const char *refspec_prefix,
out:
return ret;
}
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static gboolean do_ref (OstreeRepo *repo, const char *refspec_prefix, GCancellable *cancellable, GError **error)
{
gboolean ret = FALSE;
gboolean is_list;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (opt_collections)
return do_ref_with_collections (repo, refspec_prefix, cancellable, error);
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* If we're doing aliasing, we need the full list of aliases mostly to allow
* replacing existing aliases.
return FALSE;
}
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
const char *collection_id = ostree_repo_get_collection_id (repo);
-#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
- const char *collection_id = NULL;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* Write out a new metadata commit for the repository. */
if (collection_id != NULL)
{
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
OstreeCollectionRef collection_ref = { (gchar *) collection_id, (gchar *) OSTREE_REPO_METADATA_REF };
g_autofree char *old_ostree_metadata_checksum = NULL;
g_autofree gchar *new_ostree_metadata_checksum = NULL;
if (!ostree_repo_commit_transaction (repo, NULL, cancellable, error))
return FALSE;
-#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
- g_assert_not_reached ();
- return FALSE;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
}
/* Regenerate and sign the conventional summary file. */
BUILTINPROTO(commit);
BUILTINPROTO(diff);
BUILTINPROTO(export);
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
BUILTINPROTO(find_remotes);
BUILTINPROTO(create_usb);
-#endif
BUILTINPROTO(gpg_sign);
BUILTINPROTO(init);
BUILTINPROTO(log);
static gboolean opt_if_not_exists;
static char *opt_gpg_import;
static char *opt_contenturl;
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static char *opt_collection_id;
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static char *opt_sysroot;
static char *opt_repo;
{ "if-not-exists", 0, 0, G_OPTION_ARG_NONE, &opt_if_not_exists, "Do nothing if the provided remote exists", NULL },
{ "gpg-import", 0, 0, G_OPTION_ARG_FILENAME, &opt_gpg_import, "Import GPG key from FILE", "FILE" },
{ "contenturl", 0, 0, G_OPTION_ARG_STRING, &opt_contenturl, "Use URL when fetching content", "URL" },
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collection-id", 0, 0, G_OPTION_ARG_STRING, &opt_collection_id,
"Globally unique ID for this repository as an collection of refs for redistribution to other repositories", "COLLECTION-ID" },
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &opt_repo, "Path to OSTree repository (defaults to /sysroot/ostree/repo)", "PATH" },
{ "sysroot", 0, 0, G_OPTION_ARG_FILENAME, &opt_sysroot, "Use sysroot at PATH (overrides --repo)", "PATH" },
{ NULL }
"gpg-verify",
g_variant_new_variant (g_variant_new_boolean (FALSE)));
-#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (opt_collection_id != NULL)
g_variant_builder_add (optbuilder, "{s@v}", "collection-id",
g_variant_new_variant (g_variant_new_take_string (g_steal_pointer (&opt_collection_id))));
-#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
options = g_variant_ref_sink (g_variant_builder_end (optbuilder));